package xyz.syyrjx.blog.util;

import java.util.ArrayList;
import java.util.List;
import java.util.Random;

public class FoodRandomUtil {
    public static List<Integer> get(Integer canteenNum,Integer floorNum){
        Random random = new Random();
        if(canteenNum == null || canteenNum == 0){
            canteenNum = random.nextInt(3) + 1;
        }
        if(floorNum == null || floorNum == 0){
            if(canteenNum == 1){
                floorNum = random.nextInt(3) + 1;
            }else {
                floorNum = random.nextInt(2) + 1;
            }
        }
        if(canteenNum == 3){
            floorNum = 0;
        }

        List<Integer> list = new ArrayList<>();
        list.add(canteenNum);
        list.add(floorNum);

        return list;
    }
}
